-- GENERATED SPELL FOR [Plagued Dragonflayer Rune-Caster] --


function spell0_24198(pUnit, Event) --@Corruption,n/a--
pUnit:FullCastSpellOnTarget(47782,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24198', 26000, 1)
end

function spell1_24198(pUnit, Event) --@Flame Shock,n/a--
pUnit:FullCastSpellOnTarget(15616,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_24198', 12000, 1)
end

function spell2_24198(pUnit, Event) --@Plagued Blood Explosion,Self--
pUnit:FullCastSpellOnTarget(42167,pUnit)
pUnit:RegisterEvent('Sorts_24198', 2312, 1)
end

function Sorts_24198(pUnit, Event)
local choix_sorts_24198 = math.random(0, 2)
if choix_sorts_24198 == 0 then
pUnit:RegisterEvent('spell0_24198', 1, 1)
end
if choix_sorts_24198 == 1 then
pUnit:RegisterEvent('spell1_24198', 1, 1)
end
if choix_sorts_24198 == 2 then
pUnit:RegisterEvent('spell2_24198', 1, 1)
end
end

function mob24198_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_24198', math.random(1500, 3000), 1)
end

function mob24198_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24198_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob24198_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(24198, 1, 'mob24198_Action')
RegisterUnitEvent(24198, 2, 'mob24198_Leave')
RegisterUnitEvent(24198, 3, 'mob24198_Kill')
RegisterUnitEvent(24198, 4, 'mob24198_Die')
